import * as types from '../types'
import {Tools} from "../../lib/tools";
import {goSign} from '@/api'
import router from '@/router'

const state = {}
const getters = {}
const actions = {
    [types.GO_TO_SIGN]() {
        goSign(
            {
                json: {
                    "service": 'h5Sign',
                    "wxRequestDate": (new Date()).format("yyyyMMddhhmmss"),
                }
            }).then(data => {
            window.location.href = data.url
        }).catch(data => {
            alert("系统异常")
            // window.location.href = data.url
        })
    }
}

const mutations = {}

export default {
    namespaced: true,
    state,
    actions,
    mutations,
    getters
}